﻿using BootstrapBlazorApp.Shared.Data;
using Microsoft.AspNetCore.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.Http.Json;
using System.Diagnostics.CodeAnalysis;

namespace BootstrapBlazorApp.Shared.Pages
{
    public partial class FetchData
    {
        private List<Department>? Departments { get; set; } = new List<Department>();
        private List<Department>? Templist { get; set; } = new List<Department>();

        [Inject]
        private HttpClient? httpClient { get; set; }

        protected override async Task OnInitializedAsync()
        {
            Departments = await httpClient!.GetFromJsonAsync<List<Department>>("Department");
        }

        private async Task<IEnumerable<Department>?> OnTreeExpand(Department foo)
        {
            await Task.Delay(1000);
            return null;
            
        }

    }
}
